home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010921-20020314 / 000079_fdc@watsun.cc.columbia.edu_Fri Oct 26 16:38:23 EDT 2001.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  84 lines

  1. Article: 12893 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
  3. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.unix.aix,comp.protocols.kermit.misc
  5. Subject: Re: rm files found by find command in script
  6. Date: 26 Oct 2001 20:35:55 GMT
  7. Organization: Columbia University
  8. Lines: 67
  9. Message-ID: <9rchfb$h0v$1@newsmaster.cc.columbia.edu>
  10. References: <37ffcf4.0110242123.e886cea@posting.google.com> <3BD805A9.8FA3314D@nogui.se> <3BD94D6B.8FD50FFD@sql.de> <3BD9D979.6A24ED2E@nogui.se>
  11. NNTP-Posting-Host: watsun.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1004128555 17439 128.59.39.2 (26 Oct 2001 20:35:55 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 26 Oct 2001 20:35:55 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.unix.aix:224957 comp.protocols.kermit.misc:12893
  16.  
  17. In article <3BD9D979.6A24ED2E@nogui.se>, Christer Palm  <palm@nogui.se> wrote:
  18. : Joerg Bruehe wrote:
  19. : > I do put my foot down and do not allow Microsoft style "names"
  20. : > (like "Own Programs" etc.) in any Unix tool (script) I write.
  21. : > I see no reason why such names should be used, all they bring
  22. : > you is additional difficulties (which fits their MS origin).
  23. : I was primarly thinking about the security implications and the risk for
  24. : nasty surprises when using xargs together with destructive commands such
  25. : as rm. Using it with unknown input data by putting it inside an
  26. : automated script, or using it on large sets of files (which I assume was
  27. : the intention of the original poster) is definitely risky.
  28. : This can hardly be avoided by simply setting up a policy.
  29. Excellent points.
  30.  
  31. : It is quite clear that spaces, newlines, asterisks and everything else
  32. : except for '\0' and '/' are perfectly valid in UNIX filenames, and that
  33. : they are so by deliberate design. It is also quite clear that it is
  34. : extremely hard to write shell scripts that flawlessly handle those
  35. : characters. Especially when processing a list of filenames.
  36. Which is why, sometimes the Unix building-block approach is not ideal,
  37. and the monolithic do-all application can offer bit more utility and
  38. safety.  Again, here's C-Kermit 8.0:
  39.  
  40.   http://www.columbia.edu/kermit/ck80.html
  41.  
  42. First let's list the files in the current directory:
  43.  
  44.   C-Kermit>dir
  45.   -rw-rw----       833  2001-10-26 16:27:12  *.*
  46.   -rw-rw----      1511  2001-10-26 16:27:27  -f
  47.   -rw-rw----      6263  2001-10-26 16:25:58  oofa.txt
  48.   -rw-rw----      2277  2001-10-26 16:26:16  this file
  49.   -rw-rw----      3065  2001-10-26 16:26:34  this is a file too
  50.  
  51. Yikes, they have funny names.  What would happen if I tried to delete
  52. them?
  53.  
  54.   C-Kermit>del /sim *
  55.    *.* (SELECTED)
  56.    -f (SELECTED)
  57.    oofa.txt (SELECTED)
  58.    this file (SELECTED)
  59.    this is a file too (SELECTED)
  60.  
  61. It says it would do the right thing.  Will it really?
  62.  
  63.   C-Kermit>del /list *
  64.    *.* (OK)
  65.    -f (OK)
  66.    oofa.txt (OK)
  67.    this file (OK)
  68.    this is a file too (OK)
  69.  
  70. Yes.  checking:
  71.  
  72.   C-Kermit>dir
  73.   C-Kermit>
  74.  
  75. The files are gone.  No confusion over the boundaries between filenames,
  76. files whose names contain metacharacters or resemble rm options, etc, and
  77. no obscure syntax was required.
  78.  
  79. - Frank
  80.